import java.sql.Array;
import java.util.Scanner;
import java.util.Arrays;
public class Test {

    public static void main(String[] args) {
        int[] a = {1,2,3,4,5};
        printArray(a);
    }

    /*
    public static String myToString(int[] a){
        String res = "[";
        for (int i = 0; i < a.length; i++){
            res += a[i];
            if (i < a.length - 1) {
                res += ", ";
            }
        }
        res += "]";
        return res;
    }

    public static void main(String[] args) {
        int[] a = {1,2,3,4,5};
        String ans = myToString(a);
        String tmp = Arrays.toString(a);
        System.out.println(tmp);
        System.out.println(ans);
    }
    */
    /*
    public static int[] myCopyOf(int[] a, int len){
        int[] tmp = new int[len];
        for (int i = 0; i < len; i++){
            tmp[i] = a[i];
        }
        return tmp;
    }

    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        int[] newArr = myCopyOf(arr,arr.length);
        for (int x : newArr){
            System.out.print(x+" ");
        }
    }
    */
    /*
    public static int findOne(int[] a,int len){
        int res = 0;
        for (int i = 0; i < len; i++){
            res ^= a[i];
        }
        return res;
    }

    public static void main(String[] args) {
        int[] a = {1,1,2,2,4};
        System.out.println(findOne(a,a.length));
    }
    */
    /*
    public static void main(String[] args) {
        int[] arr = {1,3,4,5,2};

        for (int i = 0; i < arr.length - 1; i++){
            for (int j = 0; j < arr.length - 1 - i; j++){
                if (arr[j] > arr[j+1]){
                    int tmp = arr[j];
                    arr[j] = arr[j+1];
                    arr[j+1] = tmp;
                }
            }
        }

        for (int x : arr){
            System.out.print(x+" ");
        }
    }
*/
    /*
    public static boolean isSequential(int[] a,int len){
        for (int i = 0; i < len - 1; i++){
            if (a[i] > a[i+1]){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        int[] arr1 = {1,3,2,5,4};
        int[] arr2 = {1,2,3,4,5};
        if (isSequential(arr1,arr1.length)){
            System.out.println("arr1有序的");
        } else {
            System.out.println("arr1无序的");
        }

        if (isSequential(arr2,arr2.length)){
            System.out.println("arr2有序的");
        } else {
            System.out.println("arr2无序的");
        }
    }
*/

    /*
    public static int binarySearch(int[] a,int k){
        int l = 0;
        int r = a.length;
        int idx = -1;
        while(l <= r){
            int mid = l + r >>> 1;
            if (k < a[mid]){
                r = mid - 1;
            } else if (k > a[mid]) {
                l = mid + 1;
            } else {
                idx = mid;
                break;
            }
        }
        return idx;
    }

    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5,6,7};
        int idx = binarySearch(arr,6);
        if (idx != -1){
            System.out.println(arr[idx]);
        } else {
            System.out.println("没有这个元素");
        }
    }


    public static void main1(String[] args) {
        int[] arr = new int[100];
        for (int i = 0; i < 100; i++){
            arr[i] = i+1;
        }
        for (int x : arr){
            System.out.print(x+" ");
        }
    }
*/
    /*
    public static int sum(int[] tmp, int len){
        int res = 0;
        for(int i = 0 ; i < len; i++){
            res += tmp[i];
        }
        return res;
    }

    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        System.out.println(sum(arr,arr.length));
    }
*/

/*
    public static double ave(int[] tmp,int len) {
        int res = 0;
        for (int i = 0; i < len; i++) {
            ;res += tmp[i];
        }
        return res / len;
    }

    public static void main(String[] args) {
        int[] arr = {1,2,3,4,5};
        System.out.println(ave(arr,arr.length));
    }
*/
    /*
    public static int sum(int a,int b) {
        return a + b;
    }

    public static double sum(double x1,double x2,double x3) {
        return x1+x2+x3;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println(sum(a,b));
        double x1,x2,x3;
        x1 = sc.nextDouble();
        x2 = sc.nextDouble();
        x3 = sc.nextDouble();
        System.out.println(sum(x1,x2,x3));
    }
*/

/*

    public static int fib(int n) {
        if (n == 1 || n == 2) return 1;
        return fib(n-1) + fib(n-2);
    }
    public static void main5(String[] args) {
        //1 1 2 3 5 8 13 21 34 55
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(fib(n));
    }


    public static int sum2(int n){
        if (n == 0) return 0;
        return n % 10 + sum2(n / 10);
    }


    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(sum(n));
    }


    public static void print(int n) {
        if (n == 0) return;
        print(n/10);
        System.out.print(n%10+" ");
    }

    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        print(n);
    }




    public static int sum1(int n) {
        if (n == 0) return 0;
        return n + sum(n-1);
    }
    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(sum(n));
    }



    public static int fac(int n) {
        if (n == 1) return 1;
        return n * fac(n-1);
    }
    public static void main1(String[] args) {
        int n = 0;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int ans = fac(n);
        System.out.println(ans);
    }
    */

}
